package org.example;

import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.example.service.AppService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;

import javax.annotation.Resource;

/**
 * @author zhaomu
 */
@Slf4j
@SpringBootApplication
@EnableDubbo
@ComponentScan("cn.hy")
@ImportResource(value = "classpath:provider.xml")
public class App implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(App.class,args);
    }


   // @DubboReference
    @Resource
    AppService appService;

    @Override
    public void run(String... args) throws Exception {
       log.info("app {}",appService.app());
    }
}
